from sanic import Sanic
from tortoise.contrib.sanic import register_tortoise
from views import v
from config import BaseConfig


app = Sanic(__name__)
# 加载并注册数据库连接
app.update_config(BaseConfig)
register_tortoise(
    app, config=app.config["DB_CONFIG"], generate_schemas=False
)
app.blueprint(v)

if __name__ == '__main__':
    app.run()